require('Anal')
require('Calcul')
require('Action')
require('Simulation')
require('Simulate')
require('Pool')

log = io.open("res", "w")
log:write("# Trade Start #\n")

Anal:init(io.read("*number"), io.read("*number"))
Pool:init()

while (Anal.day > 0) do
   Anal:update(io.read("*number"))
   print()
   Pool:update()
end

log:write("# Trade end #\n")